//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tool.ahibernate.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

public class MyDBHelper extends SQLiteOpenHelper {
    private Class<?>[] modelClasses;

    public MyDBHelper(Context context, String databaseName, CursorFactory factory, int databaseVersion, Class<?>[] modelClasses) {
        super(context, databaseName, factory, databaseVersion);
        this.modelClasses = modelClasses;
    }

    public void onCreate(SQLiteDatabase db) {
        TableHelper.createTablesByClasses(db, this.modelClasses);
    }

    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        TableHelper.dropTablesByClasses(db, this.modelClasses);
        this.onCreate(db);
    }
}
